﻿@inject IStringLocalizer<BootstrapBlazor.Shared.Samples.Radios> Localizer

<div class="row g-3">
    <div class="col-12">
        <RadioList TValue="string" Items="@DemoValues" Color="@Color.Primary"></RadioList>
    </div>
    <div class="col-12">
        <RadioList TValue="string" Items="@DemoValues" Color="@Color.Success"></RadioList>
    </div>
    <div class="col-12">
        <RadioList TValue="string" Items="@DemoValues" Color="@Color.Danger"></RadioList>
    </div>
    <div class="col-12">
        <RadioList TValue="string" Items="@DemoValues" Color="@Color.Info"></RadioList>
    </div>
    <div class="col-12">
        <RadioList TValue="string" Items="@DemoValues" Color="@Color.Warning"></RadioList>
    </div>
    <div class="col-12">
        <RadioList TValue="string" Items="@DemoValues" Color="@Color.Secondary"></RadioList>
    </div>
</div>

@code {
    [NotNull]
    private IEnumerable<SelectedItem>? DemoValues { get; set; }

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        DemoValues = new List<SelectedItem>(2)
        {
            new SelectedItem("1", Localizer["Item1"]),
            new SelectedItem("2", Localizer["Item2"]) { IsDisabled = true }
        };
    }
}
